package com.aier.common.common;

import java.util.HashMap;
import java.util.TimerTask;

import com.aier.src.common.SystemStatic;
import com.aier.user.entity.User;

/**
 * 系统登陆用户信息清除器
 * @author Administrator
 *
 */
public class SystemLoadClear extends TimerTask {

    @Override
    public void run() {
        if(null==SystemStatic.android_user){
            SystemStatic.android_user=new HashMap<String, Integer>();
        }
        if(null==SystemStatic.android_user_account_list){
            SystemStatic.android_user_account_list=new HashMap<String, User>();
        }
        if(SystemStatic.android_user.size()<=0){
            SystemStatic.android_user_account_list.clear();
            return;
        }
        
        for(String key:SystemStatic.android_user.keySet()){
            Integer iv=SystemStatic.android_user.get(key);
            if(null==iv||iv<=0){
                SystemStatic.android_user.remove(key);
                SystemStatic.android_user_account_list.remove(key);
                continue;
            }
            SystemStatic.android_user.put(key,--iv);
        }

    }

}
